# coding=utf-8
# 使用字典
dictionary = {}
while True:
    student = raw_input("Please give me th name of student ('q' to quit):")
    if student == 'q':
        keys = dictionary.keys()
        print("Student\tGrade")
        for key in keys:
            print(key + "\t" + str(dictionary.get(key)))
        break
    grade = raw_input("Please give me his/her grade:")
    while not grade.isdigit():
        print("input has error,grade is a num")
        grade = raw_input("Please give me his/her grade:")

    dictionary[student] = int(grade)
